package cn.edu.nit.sys.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

/**
 * @Author xiaobai
 * @Date 2022/9/26 21:30
 * @Version 1.0.0
 */
@Data
@TableName("sys_employee")
public class Employee {

    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;
    private String name;
    private String phone;
    private String sex;
    private String birth;
    private Integer stateId;
    private String stateName;
    private Integer typeCode;
    private String typeName;
    private String joinUs;
    private String createTime;

    public String getStateName() {
        if("0".equals(stateId)) {
            return "离职";
        }else if("1".equals(stateId)) {
            return "休息";
        }else if("2".equals(stateId)) {
            return "正常";
        }
        return "待激活";
    }

}
